<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

<div class="modal-dialog ms-modal-dialog" style="margin-top:50px;">
	<div class="modal-content" <c:choose>
		<c:when test="${fn:indexOf(projectPhase.project.secondCategory.name,'非人')>=0 }"> style="width:170%;left:-30%"</c:when>
		<c:otherwise>style="width:150%"</c:otherwise>
		</c:choose> >

		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			<h4 class="modal-title">学员成绩录入-${projectPhase.project.name}-第<c:out value="${projectPhase.phase}"/>期</h4>
		</div>
		<form class="form-horizontal ms-form form-personal-info" method="POST" action="${ctx.host}/project-results/${projectPhase.id}/trainee-score-list" data-validate="true">

			<input type="hidden" name="_method" value="PATCH" />

			<input type="hidden" name="projectPhaseId" value="${projectPhase.id}" />
			<input type="hidden" name="currentPhase" value="${projectPhase.phase}" />

			<div class="modal-body">

				<table class="table table-hover umu-table tab-pane table-striped">
					<thead>
						<tr>
							<th>姓名</th>
							<th>学员邮箱</th>
							<th class="text-center">成绩</th>
							<th class="text-center">缺勤</th>
							<th class="text-center">是否补考</th>
							<c:if test="${projectPhase.phase==projectPhase.project.phaseCount }">
								<th class="text-center">是否结业</th>
							</c:if>
							<th class="text-center">备注</th>
							<c:if test="${fn:indexOf(projectPhase.project.secondCategory.name,'非人')>=0 }">
								<th class="text-center">现场笔试成绩</th>
								<th class="text-center">面试官认证次数</th>
								<th class="text-center">面试官认证</th>
								<th class="text-center">辅导师认证次数</th>
								<th class="text-center">辅导师认证</th>
								<th class="text-center">是否种子</th>
							</c:if>
						</tr>
					</thead>

					<tbody>
						<c:forEach items="${projectTrainees}" var="projectTrainee">
							<tr>
								<input type="hidden" value="${projectTrainee.trainee.id}" name="traineeIds" />
								<td nowrap>${projectTrainee.trainee.name}</td>
								<td>${projectTrainee.trainee.email}</td>
								<td>
									<input type="text" class="form-control" style="width:55px" data-validate="number|min,0|max,100" name="score" placeholder="成绩" value="${trainingResults[projectTrainee.trainee.id].score}">
								</td>
								<td>
									<input type="text" class="form-control" style="width:55px" data-validate="number" name="absence" placeholder="缺勤" value="${trainingResults[projectTrainee.trainee.id].absence}">
								</td>
								<td>
									<select name="resitTraineeIds">
										<option></option>
										<option value="true">是</option>
										<option value="false">否</option>
									</select>
								</td>
								<c:choose>
									<c:when test="${projectPhase.phase==projectPhase.project.phaseCount }">
										<td>
											<input type="checkbox" name="completeTraineeIds" value="${projectTrainee.trainee.id}" <c:if test="${projectTrainee.complete }">checked</c:if>/>
										</td>
									</c:when>
									<c:otherwise>
										<input type="hidden" name="completeTraineeIds" value="" />
									</c:otherwise>
								</c:choose>
								<td>
									<input type="text" name="comment" value="${trainingResults[projectTrainee.trainee.id].comment}" />
								</td>
								<c:if test="${fn:indexOf(projectPhase.project.secondCategory.name,'非人')>=0 }">

									<td>
										<input type="text" name="spotScore" class="form-control" style="width:55px" data-validate="number|min,0|max,100" value="${trainingResults[projectTrainee.trainee.id].spotScore}" />
									</td>
									<td>
										<input type="text" name="interviewerCertifyTimes" class="form-control" style="width:55px" data-validate="number" value="${trainingResults[projectTrainee.trainee.id].interviewerCertifyTimes}" />
									</td>
									<td>
										<select name="interviewerCertification">
											<option></option>
											<option <c:if test="${'通过' eq trainingResults[projectTrainee.trainee.id].interviewerCertification  }">selected</c:if> >通过</option>
								<option <c:if test="${'未通过' eq trainingResults[projectTrainee.trainee.id].interviewerCertification  }">selected</c:if> >未通过</option>
								<option <c:if test="${'未认证' eq trainingResults[projectTrainee.trainee.id].interviewerCertification  }">selected</c:if>>未认证</option>
								</select>
								</td>
								<td>
									<input type="text" name="counselorCertifyTimes" class="form-control" style="width:55px" data-validate="number" value="${trainingResults[projectTrainee.trainee.id].counselorCertifyTimes}" />
								</td>
								<td>
									<select name="counselorCertification">
										<option></option>
										<option <c:if test="${'通过' eq trainingResults[projectTrainee.trainee.id].counselorCertification  }">selected</c:if> >通过</option>
										<option <c:if test="${'未通过' eq trainingResults[projectTrainee.trainee.id].counselorCertification  }">selected</c:if> >未通过</option>
										<option <c:if test="${'未认证' eq trainingResults[projectTrainee.trainee.id].counselorCertification  }">selected</c:if>>未认证</option>
									</select>
								</td>
								<td>
									<select name="seed">
										<option></option>
										<option <c:if test="${'是' eq trainingResults[projectTrainee.trainee.id].seed  }">selected</c:if> >是</option>
										<option <c:if test="${'否' eq trainingResults[projectTrainee.trainee.id].seed  }">selected</c:if> >否</option>
									</select>
								</td>
								</c:if>
							</tr>
						</c:forEach>
					</tbody>
					<input type="hidden" name="completeTraineeIds" value="" />
					<input type="hidden" name="resitTraineeIds" value="" />

					<!-- 非人相关 -->
					<input type="hidden" name="spotScore" value="" />
					<input type="hidden" name="interviewerCertifyTimes" value="" />
					<input type="hidden" name="interviewerCertification" value="" />
					<input type="hidden" name="counselorCertifyTimes" value="" />
					<input type="hidden" name="counselorCertification" value="" />
					<input type="hidden" name="seed" value="" />

				</table>
			</div>

			<div class="modal-footer ms-modal-footer">
        <button type="submit" class="btn btn-shadow-success btn-shadow umu-btn">确定</button>&nbsp;
        <button type="button" class="btn btn-shadow-success btn-shadow umu-btn" data-dismiss="modal">取消</button>
      </div>
		</form>

	</div>
</div>
